<!DOCTYPE html>
<html>
<head>
    <title>预约管理</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.2/style/weui.min.css ">
    <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.0/css/jquery-weui.min.css ">
    <link rel="stylesheet" href="https://jqweui.cn/dist/demos/css/demos.css ">
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_587767_rj4fkdnklqttvs4i.css ">
    <script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js "></script>
    <link rel="stylesheet" type="text/css" href="__TMPL__/public/assets/css/mui.min.css">
    <script src="__TMPL__/public/assets/js/mui.min.js"></script>
</head>
<body style="background: #eeefef">
<header class="mui-bar mui-bar-nav" style="padding: 0px">
    <!--头部开始-->
    <div class="weui-flex" style="border-bottom: 1px solid gainsboro;background: #FCFCFC;height: 45px;">
        <div class="weui-flex__item" style="margin-top: 15px;">
            <div class="placeholder" style="margin-left: 10px;margin-top: -5px;">
                <a href="{:url('/portal/teacher/teacher','teacher_id=8')}"><span  style="color: #04BE02;" onclick="history.back()" class="icon  icon-back"></span>
                </a></div>
        </div>

        <div class="weui-flex__item">
            <div class="placeholder" style="text-align: center;margin-top: 10px; color: #404040;">预约管理</div>
        </div>

        <div class="weui-flex__item">
            <div class="placeholder"></div>
        </div>
        <!--<a   href="{:url('/portal/teacher/subscribe_accept','teacher_id=8')}"   style="margin-top: 10px;margin-right: 12px;color: #04BE02;font-size: 12px" >查看已接受</a>-->
    </div>
    <!--头部结束-->
    <div class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted" style="margin-top: -7px;background-color: white">
        <a class="mui-control-item mui-active" href="#item1">全部</a>
        <a class="mui-control-item" href="#item2">待确认</a>
        <a class="mui-control-item" href="#item3">已确认</a>
    </div>
</header>
<div class="mui-content">


    <div style="margin-top: 42px">
        <div id="item1" class="mui-control-content mui-active">
            <ul class="mui-table-view">
                <volist name="res" id="vo">
                    <li class="mui-table-view-cell" style="padding: 0px">
                        <div class="mui-row">
                            <div class="mui-col-sm-12 mui-col-xs-12"  style=";border-bottom: 1px #eeefef solid;">
                                <a href="##" style="color: darkslategrey">
                                    <div class="mui-row" style="padding: 11px 15px;background-color: #f7f8f8">
                                        <div class="mui-col-sm-3 mui-col-xs-3">
                                            <img src="__TMPL__/public/assets/images/demo/techer1.jpg" style="width: 71%;height: 71%;">
                                        </div>
                                        <div class="mui-col-sm-9 mui-col-xs-9">
                                            <div class="mui-col-sm-12 mui-col-xs-12" style="color: black;font-size: 12px;line-height: 20px">
                                                用户名
                                                <if condition="$vo.static eq 1">
                                                    <span style="float: right; color: #23cd77;">已同意</span>
                                                    <elseif condition="$vo.static eq -1"/>
                                                    <span style="float: right; color: #23cd77;">已拒绝</span>
                                                    <else />
                                                    <span style="float: right; color: #23cd77;">待确定</span>
                                                </if>
                                            </div>
                                            <div class="mui-col-sm-12 mui-col-xs-12" style="color: darkgrey;font-size: 12px;line-height: 20px">
                                                {$vo.time} {$vo.grade} {$vo.subject}
                                            </div>
                                            <div class="mui-col-sm-12 mui-col-xs-12" style="color: darkgrey;font-size: 12px;line-height: 20px">
                                                {$vo.content}
                                            </div>
                                        </div>
                                    </div>
                                </a>
                            </div>
                            <div class="mui-col-sm-12 mui-col-xs-12"  style="">
                                <!-- <if condition="$vo.static eq 1">
                                     <span  style="float: right"><a href="javascript:;" class="weui-btn weui-btn_mini weui-btn_default"  style="border:1px white solid" >已同意</a></span>
                                     <elseif condition="$vo.static eq -1"/>
                                     <span  style="float: right;margin-right: 8px" ><a style="border: none" href="javascript:;" class="weui-btn weui-btn_mini weui-btn_default" >已拒绝</a></span>
                                     <else />
                                     <span  style="float: right;margin-right: 8px" ><a style="border: none" href="javascript:;" class="weui-btn weui-btn_mini weui-btn_default" >待确定</a></span>
                                 </if>-->




                            </div>
                            <!-- <div class="mui-col-sm-3 mui-col-xs-3">
                                 <div class="mui-row">
                                     <div class="mui-col-sm-12 mui-col-xs-12">
                                         <button type="button" class="mui-btn mui-btn-green" onclick="accept({$vo['id']})">接受</button>
                                     </div>
                                 </div>
                                 <div class="mui-row" style="margin-top: 5px">
                                     <div class="mui-col-sm-12 mui-col-xs-12">
                                         <button type="button" class="mui-btn mui-btn-red" onclick="reject({$vo['id']})">拒绝</button>
                                     </div>
                                 </div>
                             </div>-->
                        </div>
                    </li>
                </volist>

            </ul>

        </div>

        <div id="item2" class="mui-control-content">
            <ul class="mui-table-view">
                <volist name="res_dai" id="vo">
                    <li id="{$vo['id']}" class="mui-table-view-cell" style="padding: 0px">
                        <div class="mui-row">
                            <div class="mui-col-sm-12 mui-col-xs-12"  style=";border-bottom: 1px #eeefef solid;background-color: #f7f8f8">
                                <a href="##" style="color: darkslategrey">
                                    <div class="mui-row"  style="padding: 11px 15px;background-color: #f7f8f8">
                                        <div class="mui-col-sm-3 mui-col-xs-3">
                                            <img src="__TMPL__/public/assets/images/demo/techer1.jpg" style="width: 71%;height: 71%;">
                                        </div>
                                        <div class="mui-col-sm-9 mui-col-xs-9">
                                            <div class="mui-col-sm-12 mui-col-xs-12" style="color: black;font-size: 12px;line-height: 20px">
                                                用户名
                                            </div>
                                            <div class="mui-col-sm-12 mui-col-xs-12" style="color: darkgrey;font-size: 12px;line-height: 20px">
                                                {$vo.time} {$vo.grade} {$vo.subject}
                                            </div>
                                            <div class="mui-col-sm-7 mui-col-xs-7" style="color: darkgrey;font-size: 12px;line-height: 20px">
                                                {$vo.content}
                                            </div>
                                        </div>
                                    </div>
                                </a>
                                <div class="mui-col-sm-12 mui-col-xs-12" style="margin-top: -40px;margin-right: 20px">
                                 <span  style="float: right">
                                <a href="javascript:;" class="weui-btn weui-btn_mini weui-btn_default" onclick="accept({$vo['id']})" style="border:1px white solid" >同意</a>
                            </span>
                                    <span  style="float: right;margin-right: 8px" ><a style="border: none" href="javascript:;" onclick="reject({$vo['id']})" class="weui-btn weui-btn_mini weui-btn_default" >拒绝</a></span>
                                </div>
                            </div>
                            <!-- <div class="mui-col-sm-12 mui-col-xs-12"  style="margin-top: 8px;">
                             <span  style="float: right">
                                 <a href="javascript:;" class="weui-btn weui-btn_mini weui-btn_default" onclick="accept({$vo['id']})" style="border:1px white solid" >同意</a>
                             </span>
                                 <span  style="float: right;margin-right: 8px" ><a style="border: none" href="javascript:;" onclick="reject({$vo['id']})" class="weui-btn weui-btn_mini weui-btn_default" >拒绝</a></span>
                             </div>-->
                            <!-- <div class="mui-col-sm-3 mui-col-xs-3">
                                 <div class="mui-row">
                                     <div class="mui-col-sm-12 mui-col-xs-12">
                                         <button type="button" class="mui-btn mui-btn-green" onclick="accept({$vo['id']})">接受</button>
                                     </div>
                                 </div>
                                 <div class="mui-row" style="margin-top: 5px">
                                     <div class="mui-col-sm-12 mui-col-xs-12">
                                         <button type="button" class="mui-btn mui-btn-red" onclick="reject({$vo['id']})">拒绝</button>
                                     </div>
                                 </div>
                             </div>-->
                        </div>
                    </li>
                </volist>

            </ul>
        </div>

        <div id="item3" class="mui-control-content">
            <ul class="mui-table-view">
                <volist name="res_accept" id="vo1">
                    <li id="{$vo1['id']}" class="mui-table-view-cell" style="padding: 0px">
                        <div class="mui-row">
                            <div class="mui-col-sm-12 mui-col-xs-12" style=";border-bottom: 1px #eeefef solid;">
                                <a href="##" style="color: darkslategrey">
                                    <div class="mui-row"  style="padding: 11px 15px;background-color: #f7f8f8">
                                        <div class="mui-col-sm-3 mui-col-xs-3">
                                            <img src="__TMPL__/public/assets/images/demo/techer1.jpg" style="width: 71%;height: 71%;">
                                        </div>
                                        <div class="mui-col-sm-9 mui-col-xs-9">
                                            <div class="mui-col-sm-12 mui-col-xs-12" style="color: black;font-size: 12px;line-height: 20px">
                                                用户名
                                                <if condition="$vo1.static eq 1">
                                                    <span style="float: right; color: #23cd77;">已同意</span>
                                                    <elseif condition="$vo1.static eq -1"/>
                                                    <span style="float: right; color: #23cd77;">已拒绝</span>
                                                    <else />
                                                    <span style="float: right; color: #23cd77;">待确定</span>
                                                </if>
                                            </div>
                                            <div class="mui-col-sm-12 mui-col-xs-12" style="color: darkgrey;font-size: 12px;line-height: 20px">
                                                {$vo1.time} {$vo1.grade} {$vo1.subject}
                                            </div>
                                            <div class="mui-col-sm-7 mui-col-xs-7" style="color: darkgrey;font-size: 12px;line-height: 20px">
                                                {$vo1.content}
                                            </div>
                                        </div>
                                    </div>
                                </a>
                                <div class="mui-col-sm-12 mui-col-xs-12" style="margin-top: -40px;">
                                    <span  style="float: right;margin-right: 8px"><a style="border: none"  href="javascript:;" onclick="del({$vo1['id']})" class="weui-btn weui-btn_mini weui-btn_default">删除</a></span>
                                </div>
                            </div>

                        </div>
                    </li>
                </volist>

            </ul>
        </div>
    </div>
</div>


<script src="__TMPL__/public/assets/js/jquery-2.1.4.js"></script>
<script src="__TMPL__/public/assets/js/fastclick.js"></script>
<script>
    $(function() {
        FastClick.attach(document.body);
    });
</script>
<script src="__TMPL__/public/assets/js/jquery-weui.js"></script>
<script src="__TMPL__/public/assets/js/city-picker.js"></script>
<script>

    $(".delete6").click(function () {
        window.location.href = "{:url('Teacher/')}";
    });
    function reject(id){
        $.ajax({
            type:"post",
            url:"{:url('/portal/Teacher/subscribe_del')}",
            dataType:'JSON',
            data:{rejecd_id:id},
            error: function (data){
                mui.toast('拒绝失败');
            },
            success: function (data) {
                mui.toast('成功拒绝');
                document.getElementById(id).remove();
            }
        });
    }
    function accept(id){
        $.ajax({
            type:"post",
            url:"{:url('/portal/Teacher/subscribe_del')}",
            dataType:'JSON',
            data:{accept_id:id},
            error: function (data){
                mui.toast('接受失败');
            },
            success: function (data) {
                mui.toast('成功接受');
                document.getElementById(id).remove();
            }
        });
    }
    function del(id){
        $.ajax({
            type:"post",
            url:"{:url('/portal/Teacher/subscribe_del')}",
            dataType:'JSON',
            data:{del_id:id},
            error: function (data){
                mui.toast('删除失败');
            },
            success: function (data) {
                mui.toast('成功删除');
                document.getElementById(id).remove();
            }
        });
    }
</script>

</body>
</html>